#!/bin/bash

echo -e "\033[36mwhile、for、if混合实现九九乘法表\033[0m"
i=1
while [ $i -lt 10 ]
do
  for j in {1..9}
  do
    if [ $j -le $i ];then
    echo -n "$j*$i=$[ $j * $i ] "
    fi
  done
echo
let i++
done
echo
echo "===========================================================>"
echo

echo -e "\033[36mfor循环实现九九乘法表\033[0m"
for i in {1..9}
do
  for j in {1..9}
  do
  [ $i -ge $j ] && echo -n "$j*$i=$[ $j * $i ] "
  done
echo
done
echo
echo "===========================================================>"
echo

echo -e "\033[36mwhile实现九九乘法表\033[0m"
i=1
while [ $i -lt 10 ]
do
j=1
  while [ $j -lt 10 ]
  do
  [ $i -ge $j ] && echo -n "$j*$i=$[ $j * $i ] "
  let j++
  done
let i++
echo
done























